package com.xuxin.pda.presenter;

import com.xuxin.pda.bean.BaseBean;
import com.xuxin.pda.bean.CompanyBean;
import com.xuxin.pda.bean.TrashExitBean;
import com.xuxin.pda.bean.WarehouseBean;
import com.xuxin.pda.contract.TrashExitContract;
import com.xuxin.pda.model.TrashExitModel;

/**
 * Created by xu_xin
 * Created on 2021/2/7 0007
 */
public class TrashExitPresenter implements TrashExitContract.Presenter {
    private final TrashExitModel model;
    private final TrashExitContract.View view;

    public TrashExitPresenter(TrashExitContract.View view) {
        this.view = view;
        model = new TrashExitModel();
    }

    @Override
    public void GetWarehouseInfo(String WarehouseId) {
        if (null != model) {
            model.GetWarehouseInfo(this, WarehouseId);
        }
    }

    @Override
    public void trashExit(String name, String WarehouseId, String UserId, String message) {
        if (null != model) {
            model.trashExit(this, name, WarehouseId, UserId, message);
        }
    }

    @Override
    public void GetCompany() {
        if (null != model) {
            model.GetCompany(this);
        }
    }

    @Override
    public void onSuccess(WarehouseBean warehouseBean) {
        if (null != view) {
            view.onSuccess(warehouseBean);
        }
    }

    @Override
    public void onSuccess(TrashExitBean trashExitBean) {
        if (null != view) {
            view.onSuccess(trashExitBean);
        }
    }

    @Override
    public void onSuccess(CompanyBean companyBean) {
        if (null != view) {
            view.onSuccess(companyBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}